package com.lian.pet.domain.vo;

import com.lian.pet.domain.entity.PetFeedinglogs;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.Date;

@AllArgsConstructor
@Data
@Builder
@ApiModel("查询饲养记录信息")
public class PetFeedinglogsVO {
    private Integer id;
    @ApiModelProperty(value = "食物内容")
    private String food;
    @ApiModelProperty(value = "食物总量")
    private Double amount;
    @ApiModelProperty(value = "喂食时间")
    private Date feedingTime;

    public static PetFeedinglogsVO fromPetFeedinglogs(PetFeedinglogs entity) {
        return PetFeedinglogsVO.builder()
                .id(entity.getId())
                .food(entity.getFood())
                .amount(entity.getAmount())
                .feedingTime(entity.getFeedingTime())
                .build();
    }

}
